<template>
	
	<div class="app">
		
		<div class="mui-content">
			<div class="mui-content-padded">
				<h2>{{art.title}}</h2>
				<span>{{art.add_time | time("YYYY-MM-DD")}}</span>
				<p v-html="art.content"> 
					{{art.content}}
				</p>
			</div>
		</div>
		
		<comments :artid="comid"></comments>
	</div>
	
</template>

<script>
	import  commit  from "../../kits/commit.js"
	import  comments from "../puclicson/comment.vue"
	export default{
		data(){
			return{
				comid:0,
				art:{}				
			}
		},
		created(){
			this.comid = this.$route.params.id;
			this.getart(this.$route.params.id)
		},
		methods:{
			getart(newid){
				var url = commit.api + "/api/getnew/"+newid;
				this.$http.get(url).then(res=>{
					this.art = res.body.message[0];
				},res=>{
					console.log("数据获取失败")
				})
			}
			
		},
		components:{
			comments
		}
		
		
		
		
	}
	
</script>

<style scoped>
	.mui-content{
		background-color: #fff;
	}
	.mui-content-padded h2{
		color: #007AFF;
	}
	.mui-content-padded span{
		color: #007AFF;
	}
	
</style>